﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="HQWeb.SysManage.UserManage.Edit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>用户信息维护</title>
    <link href="../../Styles/Site.css" rel="Stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">
        function getXMLHttpRequest() {
            if (window.XMLHttpRequest) {
                return new window.XMLHttpRequest();
            }
            else {
                var progIDs = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP'];

                for (var i = 0; i < progIDs.length; i++) {
                    try {
                        var xmlHttp = new ActiveXObject(progIDs[i]);
                        return xmlHttp;
                    }
                    catch (ex) { }
                }

                return null;
            }
        }

        function sendRequest() {
            var xhr = getXMLHttpRequest();
            var Url = "CheckUserName.ashx?name=" + document.getElementById("txtUserName").value + "&id=" + document.getElementById("hidEditID").value;
            xhr.open("POST", Url);
            xhr.onreadystatechange = function () {
                onReadyStateChange.apply(xhr);
            }
            xhr.send(null);
        }

        function onReadyStateChange() {
            if (this.readyState == 4) {
                if (this.status == 200) {
                    // alert(this.responseText);
                    document.getElementById("Msg").innerHTML = this.responseText;
                }
                else {
                    throw new Error();
                }
            }
        }
        function GoList(pid) {
            location = "List.aspx?pid=" + pid;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table align="center" width="98%">
            <tr>
                <td colspan="4" class="title">
                    <asp:Label runat="server" ID="labTitle" Text="添加用户"> </asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" style="width: 20%">
                    用户名：
                </td>
                <td class="content">
                    <asp:TextBox ID="txtUserName" runat="server" MaxLength="20" ToolTip="用户名不超过20个字符" onfocusout="sendRequest()"></asp:TextBox><span
                        style="color: Red">*</span><asp:RequiredFieldValidator ID="RequiredFieldValidator2"
                            runat="server" ErrorMessage="用户名不能为空！" ControlToValidate="txtUserName"></asp:RequiredFieldValidator>
                           <font
                        style="color: Red;"> &nbsp;&nbsp;<label id="Msg"></label></font>
                </td>
            </tr>
            <tr>
                <td align="right">
                    真实姓名：
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtRealName" MaxLength="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    所属部门：
                </td>
                <td>
                    <asp:DropDownList ID="drop_Department" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr runat="server" id="br1" style="display: none">
                <td align="right">
                    所属店：
                </td>
                <td>
                    <asp:DropDownList ID="drop_Branch" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr runat="server" id="br2" style="display: none">
                <td align="right">
                    所属店：
                </td>
                <td>
                    <asp:Label runat="server" ID="labBR"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right">
                    职&nbsp;&nbsp;&nbsp;&nbsp; 务：
                </td>
                <td>
                    <asp:TextBox ID="txtDescrip" runat="server" MaxLength="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    电&nbsp;&nbsp;&nbsp;&nbsp; 话：
                </td>
                <td>
                    <asp:TextBox ID="txtPhone" runat="server" MaxLength="20"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    邮&nbsp;&nbsp;&nbsp;&nbsp; 箱：
                </td>
                <td>
                    <asp:TextBox ID="txtMailBox" runat="server" MaxLength="50"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnSend" runat="server" Text="提 交" CommandName="add" OnClick="btnSend_Click" />&nbsp;
                    <input id="btnCalcel" value="返 回" type="button" onclick="location='List.aspx?pid=<%=Request["pid"]%>'" />
                    <asp:Button ID="btnSetPassWord" runat="server" Text="密码初始化" OnClick="btnSetPassWord_Click" />
                    <asp:TextBox ID="txtIdHid" runat="server" Style="visibility: hidden"></asp:TextBox><!--传递唯一标识-->
                    <asp:TextBox ID="txtBrdHid" runat="server" Style="visibility: hidden"></asp:TextBox><!--传递上级记录标识-->
                    <asp:TextBox ID="txtSign" runat="server" Style="visibility: hidden"></asp:TextBox><!--传递操作-->
                    <asp:TextBox ID="hidEditID" runat="server" Text="" Style="visibility: hidden"></asp:TextBox><!--传递操作-->
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
